home *** CD-ROM | disk | FTP | other *** search
- property nextAction, currentCartoonName, currentCartoonCredits, toonDataFileName, toonDataFileNameToDelete, unsortedFileList, sortedFileList
- global fileDataList, scoreData, bgdData, bgdFXData, fgdFXData, soundFXData, soundLoopData, dispatchTable, toonDataFileList, dirtyFlag, breakChar, saveDialogBox, openDialogBox, exportDialogBox, dlogdataPath, toondataPath, exportPath, playBackMode, indexOfFileToExport, PCflag, runningOffCDflag, MSfileObj, contentList, savedToonDataIndex, fileObj
-
- on birth me
- set contentList to [EMPTY, []]
- set currentCartoonName to "Untitled"
- set currentCartoonCredits to EMPTY
- set fileDataList to [currentCartoonName, currentCartoonCredits, 0, contentList]
- set nextAction to EMPTY
- set newFlag to 0
- set toonDataFileList to []
- set toonDataFileName to EMPTY
- set breakChar to numToChar(165)
- return me
- end
-
- on exportCartoon me
- set theMessage to the text of field "Demo Message"
- set theAlertBoxType to #OK
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "nothing")
- end
-
- on doExportDialogBox me
- cursor(4)
- buildToonDataFileList(me)
- if toonDataFileList <> EMPTY then
- openExportDialogBox(me)
- else
- set theMessage to "Sorry, there are no cartoons to export."
- set theAlertBoxType to #OK
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "nothing")
- end if
- cursor(-1)
- end
-
- on openExportDialogBox me
- if objectp(exportDialogBox) then
- forget(exportDialogBox)
- end if
- set exportDialogBox to window "exportDialogBox"
- set h to the stageLeft + 140
- set v to the stageTop + 70
- set the rect of exportDialogBox to rect(h, v, h + 336, v + 294)
- set the fileName of exportDialogBox to dlogdataPath & "export"
- set the windowType of exportDialogBox to 2
- open(exportDialogBox)
- end
-
- on openCartoon me
- if dirtyFlag then
- set theMessage to "Do you want to save your changes before opening a new cartoon?"
- set theAlertBoxType to #dontsave_cancel_save
- showTheAlertBox(theMessage, theAlertBoxType, "doOpenDialogBox(fileMgr)", "nothing", "doSaveThenNextAction(fileMgr, #open)")
- else
- doOpenDialogBox(me)
- end if
- end
-
- on doOpenDialogBox me
- cursor(4)
- buildToonDataFileList(me)
- if toonDataFileList <> EMPTY then
- openOpenDialogBox(me)
- else
- set theMessage to "Sorry, there are no cartoons to open."
- set theAlertBoxType to #OK
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "nothing")
- end if
- cursor(-1)
- end
-
- on openOpenDialogBox me
- if objectp(openDialogBox) then
- forget(openDialogBox)
- end if
- set openDialogBox to window "openDialogBox"
- set h to the stageLeft + 140
- set v to the stageTop + 70
- set the rect of openDialogBox to rect(h, v, h + 336, v + 294)
- set the fileName of openDialogBox to dlogdataPath & "open"
- set the windowType of openDialogBox to 2
- open(openDialogBox)
- end
-
- on doSaveThenNextAction me, whatNext
- set nextAction to whatNext
- saveCartoon(me)
- end
-
- on saveCartoon me
- exportCartoon(me)
- end
-
- on copyCartoon me
- exportCartoon(me)
- end
-
- on generateCopyCartoonName me
- set numberOfWords to the number of words in currentCartoonName
- set numberOfChars to the number of chars in currentCartoonName
- if numberOfChars <= 12 then
- if word numberOfWords of currentCartoonName = "copy" then
- if numberOfChars <= 9 then
- return currentCartoonName && "2"
- end if
- else
- if numberOfWords > 1 then
- if integerp(integer(word numberOfWords of currentCartoonName)) and (word numberOfWords - 1 of currentCartoonName = "copy") then
- set tempName to currentCartoonName
- set count to integer(word numberOfWords of tempName + 1)
- if count > 9 then
- set count to 1
- end if
- put count into word numberOfWords of tempName
- return tempName
- else
- if numberOfChars <= 5 then
- return currentCartoonName && "copy"
- end if
- end if
- else
- if numberOfChars <= 5 then
- return currentCartoonName && "copy"
- end if
- end if
- end if
- end if
- return currentCartoonName
- end
-
- on openSaveDialogBox me
- if objectp(saveDialogBox) then
- forget(saveDialogBox)
- end if
- set saveDialogBox to window "saveDialogBox"
- set h to the stageLeft + 140
- set v to the stageTop + 70
- set the rect of saveDialogBox to rect(h, v, h + 336, v + 264)
- set the fileName of saveDialogBox to dlogdataPath & "save"
- set the windowType of saveDialogBox to 2
- open(saveDialogBox)
- end
-
- on writetoonData me, cartoonName, cartoonCredits
- set the visible of saveDialogBox to 0
- updateStage()
- cursor(4)
- showStatusBar("Saving Cartoon...")
- updateStatusBar(1)
- setCurrentCartoonName(me, cartoonName)
- updateStatusBar(1)
- setCurrentCartoonCredits(me, cartoonCredits)
- updateStatusBar(1)
- set toonDataFileName to getNewFileName(me)
- updateStatusBar(1)
- set fileDataList to []
- updateStatusBar(1)
- append(fileDataList, cartoonName)
- updateStatusBar(1)
- append(fileDataList, flattenCredits(me, cartoonCredits))
- updateStatusBar(1)
- append(fileDataList, estimateCastSize(listMgr) / 1024)
- updateStatusBar(1)
- append(fileDataList, contentList)
- updateStatusBar(1)
- writeFILEIO(me)
- updateStatusBar(100)
- set dirtyFlag to 0
- cursor(-1)
- if nextAction = #open then
- set nextAction to EMPTY
- doOpenDialogBox(me)
- else
- if nextAction = #new then
- set nextAction to EMPTY
- reset(appMgr)
- else
- if nextAction = #EXPORT then
- set nextAction to EMPTY
- doExportDialogBox(me)
- else
- if nextAction = #quit then
- set nextAction to EMPTY
- justQUit(appMgr)
- else
- updateFileNameField(appMgr)
- end if
- end if
- end if
- end if
- end
-
- on writeChangesToToonData me
- cursor(4)
- showStatusBar("Saving Cartoon...")
- updateStatusBar(1)
- setAt(fileDataList, 2, flattenCredits(me, getAt(fileDataList, 2)))
- updateStatusBar(1)
- setAt(fileDataList, 3, estimateCastSize(listMgr) / 1024)
- updateStatusBar(1)
- updateContentList(me)
- updateStatusBar(1)
- setAt(fileDataList, 4, contentList)
- updateStatusBar(1)
- writeFILEIO(me)
- updateStatusBar(100)
- set dirtyFlag to 0
- cursor(-1)
- if nextAction = #open then
- set nextAction to EMPTY
- doOpenDialogBox(me)
- else
- if nextAction = #new then
- set nextAction to EMPTY
- reset(appMgr)
- else
- if nextAction = #EXPORT then
- set nextAction to EMPTY
- doExportDialogBox(me)
- else
- if nextAction = #quit then
- set nextAction to EMPTY
- justQUit(appMgr)
- else
- updateFileNameField(appMgr)
- end if
- end if
- end if
- end if
- end
-
- on getNewFileName me
- set fileList to []
- set toonDataFileList to []
- set fileNameList to []
- repeat with i = 1 to the maxinteger
- set toonDataFile to getNthFileNameInFolder(toondataPath, i)
- if toonDataFile = EMPTY then
- exit repeat
- next repeat
- end if
- append(fileList, toonDataFile)
- end repeat
- if fileList = EMPTY then
- return 1000
- else
- sort(fileList)
- repeat with theFileNumber in fileList
- if fileNameIsNumber(me, theFileNumber) then
- set tempFileDataList to readFileListData(me, theFileNumber)
- if tempFileDataList <> EMPTY then
- append(fileNameList, theFileNumber)
- end if
- end if
- end repeat
- sort(fileNameList)
- return integer(getLast(fileNameList) + 1)
- end if
- end
-
- on readToonData me, index
- if playBackMode <> #ReturnFromExport then
- set the visible of openDialogBox to 0
- updateStage()
- cursor(4)
- showStatusBar("Opening Cartoon...")
- else
- cursor(4)
- showStatusBar("Resetting Cartoon Studio...")
- set playBackMode to #NIL
- end if
- updateStatusBar(1)
- reset(appMgr)
- updateStatusBar(1)
- set toonDataFileName to getToonDataFileName(me, index)
- updateStatusBar(1)
- readFILEIO(me)
- updateStatusBar(1)
- if PCflag then
- preloadCartoon(listMgr)
- end if
- updateStatusBar(1)
- setCurrentCartoonName(me, getAt(fileDataList, 1))
- updateStatusBar(1)
- setCurrentCartoonCredits(me, getAt(fileDataList, 2))
- updateStatusBar(1)
- set contentList to getAt(fileDataList, 4)
- updateStatusBar(1)
- updateFileNameField(appMgr)
- updateStatusBar(1)
- update(stackMgr)
- updateStatusBar(1)
- rewind(playbackMgr)
- updateStatusBar(1)
- updateTheBrain(appMgr)
- updateStatusBar(100)
- cursor(-1)
- end
-
- on getToonDataFileName me, index
- if PCflag then
- return getAt(sortedFileList, index)
- else
- return getNthFileNameInFolder(toondataPath, index)
- end if
- end
-
- on deleteCartoon me, index
- set the visible of openDialogBox to 0
- updateStage()
- set toonDataFileNameToDelete to getToonDataFileName(me, index)
- if toonDataFileNameToDelete = toonDataFileName then
- set theMessage to "The cartoon you are deleting is currently open. Do you want to close and delete the current cartoon?"
- set theAlertBoxType to #cancel_ok
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "resetAndDelete(fileMgr,toonDataFileNameToDelete)")
- else
- deleteToonData(me, toonDataFileNameToDelete)
- end if
- end
-
- on resetAndDelete me, toonDataFileNameToDelete
- deleteToonData(me, toonDataFileNameToDelete)
- reset(appMgr)
- end
-
- on deleteToonData me, toonDataFileNameToDelete
- cursor(4)
- showStatusBar("Deleting Cartoon...")
- updateStatusBar(1)
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- updateStatusBar(1)
- set fileObj to FileIO(mnew, "write", toondataPath & toonDataFileNameToDelete)
- updateStatusBar(1)
- if objectp(fileObj) then
- fileObj(mDelete)
- end if
- updateStatusBar(1)
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- updateStatusBar(100)
- cursor(-1)
- end
-
- on buildToonDataFileList me
- set unsortedFileList to []
- set sortedFileList to []
- set toonDataFileList to []
- repeat with i = 1 to the maxinteger
- set toonDataFile to getNthFileNameInFolder(toondataPath, i)
- if toonDataFile = EMPTY then
- exit repeat
- next repeat
- end if
- append(sortedFileList, toonDataFile)
- end repeat
- if sortedFileList <> EMPTY then
- set unsortedFileList to copyList(sortedFileList)
- sort(sortedFileList)
- repeat with theFileNumber in sortedFileList
- if fileNameIsNumber(me, theFileNumber) then
- set tempFileDataList to readFileListData(me, theFileNumber)
- if tempFileDataList <> EMPTY then
- append(toonDataFileList, tempFileDataList)
- end if
- end if
- end repeat
- end if
- end
-
- on fileNameIsNumber me, fileName
- set isNumber to 1
- repeat with i = 1 to 4
- set checkNum to value(char i of fileName)
- if not integerp(checkNum) then
- set isNumber to 0
- exit repeat
- end if
- end repeat
- return isNumber
- end
-
- on readFileListData me, newIndex
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- set fileObj to FileIO(mnew, "read", toondataPath & newIndex)
- if objectp(fileObj) then
- set toondataCheckStr to value(fileObj(mReadToken, breakChar, breakChar))
- if listp(toondataCheckStr) then
- if count(toondataCheckStr) = 3 then
- set tempFileDataList to value(fileObj(mReadToken, breakChar, breakChar))
- else
- set tempFileDataList to EMPTY
- end if
- else
- set tempFileDataList to EMPTY
- end if
- end if
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- return tempFileDataList
- end
-
- on flattenCredits me, cartoonCredits
- set tempString to EMPTY
- put line 1 of cartoonCredits after tempString
- repeat with i = 2 to the number of lines in cartoonCredits
- put QUOTE & "& RETURN &" & QUOTE & line i of cartoonCredits after tempString
- end repeat
- return tempString
- end
-
- on setCurrentCartoonName me, theCartoonName
- set currentCartoonName to theCartoonName
- setAt(fileDataList, 1, currentCartoonName)
- end
-
- on getCurrentCartoonName me
- return currentCartoonName
- end
-
- on setCurrentCartoonCredits me, theCartoonCredits
- set currentCartoonCredits to theCartoonCredits
- setAt(fileDataList, 2, currentCartoonCredits)
- end
-
- on getCurrentCartoonCredits me
- return currentCartoonCredits
- end
-
- on clearToonDataFileName me
- set toonDataFileName to EMPTY
- end
-
- on makeCartoonForPlayer me, fileIndex
- set the visible of exportDialogBox to 0
- updateStage()
- set playBackMode to #export_part1
- if PCflag then
- set xFileList to copyList(unsortedFileList)
- sort(xFileList)
- set toonDataFile to getAt(xFileList, fileIndex)
- set indexOfFileToExport to getPos(unsortedFileList, toonDataFile)
- else
- saveStateOfToolBox(me)
- set indexOfFileToExport to fileIndex
- set toonDataFile to getNthFileNameInFolder(toondataPath, indexOfFileToExport)
- end if
- set theMemorySize to getAt(readFileListData(me, toonDataFile), 3)
- set theFreeDiskSpace to getFreeDiskSpace(me)
- set theNeededDiskSpace to theMemorySize * 3
- if theNeededDiskSpace > theFreeDiskSpace then
- set theSpaceNeeded to integer(theNeededDiskSpace - theFreeDiskSpace)
- set theMessage to "Sorry, not enough disk space to make a cartoon." & RETURN & "An additional " & theSpaceNeeded & "K needed."
- set theAlertBoxType to #OK
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "nothing")
- exit
- end if
- unLoad()
- set theMemorySize to theMemorySize + 500
- set theFreeKB to the freeBytes / 1024
- if theMemorySize < theFreeKB then
- go("EXPORT", the moviePath & "xtmpl")
- else
- set theRAMNeeded to integer(theMemorySize - theFreeKB)
- set theMessage to "Sorry, not enough memory to make a cartoon." & RETURN & "An additional " & theRAMNeeded & "K needed."
- set theAlertBoxType to #OK
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "nothing")
- end if
- end
-
- on getFreeDiskSpace me
- if PCflag then
- set drvLst to ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"]
- set drv to char 1 of exportPath
- set driveFound to 0
- repeat with n = 1 to count(drvLst)
- if drv = getAt(drvLst, n) then
- set d to n
- set driveFound to 1
- exit repeat
- end if
- end repeat
- if not driveFound then
- set d to 0
- end if
- set freeSpace to MSfileObj(mgetdiskfree, d)
- return value(freeSpace) / 1024
- else
- set the itemDelimiter to ":"
- set v to item 1 of exportPath
- GetVInfo(v)
- set vInfo to the result
- set the itemDelimiter to ","
- return value(item 2 of vInfo)
- end if
- end
-
- on exportToonData me, fileIndex, theCartoonName
- set the visible of exportDialogBox to 0
- updateStage()
- doExportToonData(me, fileIndex, theCartoonName)
- end
-
- on importToonData me
- set the visible of openDialogBox to 0
- updateStage()
- doImportToonData(me)
- end
-
- on doExportToonData me, fileIndex, theCartoonName
- set whichFile to getToonDataFileName(me, fileIndex)
- set newFileName to theCartoonName
- if PCflag then
- set newFileName to makeDOSLegalName(me, newFileName) & ".ctd"
- else
- set newFileName to newFileName & ".ctd"
- end if
- set theFileExists to 0
- repeat with count = 1 to the maxinteger
- set theCheckFileName to getNthFileNameInFolder(exportPath, count)
- if theCheckFileName = newFileName then
- set theFileExists to 1
- exit repeat
- next repeat
- end if
- if theCheckFileName = EMPTY then
- exit repeat
- end if
- end repeat
- if theFileExists then
- set theMessage to "The file" && newFileName && "already exists. Replace it?"
- set theAlertBoxType to #cancel_ok
- set btn1script to "nothing"
- set btn2script to "nothing"
- set btn3script to "copyFile(fileMgr," & whichFile & "," & QUOTE & newFileName & QUOTE & ")"
- showTheAlertBox(theMessage, theAlertBoxType, btn1script, btn2script, btn3script)
- else
- copyFile(me, whichFile, newFileName)
- end if
- if not PCflag then
- setFileType(me, newFileName)
- end if
- end
-
- on setFileType me, fileName
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- set fileObj to FileIO(mnew, "read", exportPath & fileName)
- if objectp(fileObj) then
- fileObj(mSetFinderInfo, "M!93", "SCTB")
- fileObj(mdispose)
- end if
- end
-
- on copyFile me, whichFile, newFileName
- cursor(4)
- showStatusBar("Exporting Toon to Export Folder")
- updateStatusBar(1)
- if PCflag then
- MSfileObj(mCopyFile, toondataPath & whichFile, exportPath & newFileName)
- updateStatusBar(1)
- else
- set err to FileCopy(toondataPath & whichFile, exportPath & newFileName, "TRUE", "DontShowProgress")
- if err <> (exportPath & newFileName) then
- showTheAlertBox(err, #OK, EMPTY, EMPTY, EMPTY)
- end if
- updateStatusBar(1)
- end if
- updateStatusBar(100)
- cursor(-1)
- end
-
- on doImportToonData me
- set theMessage to the text of field "Demo Message"
- set theAlertBoxType to #OK
- showTheAlertBox(theMessage, theAlertBoxType, "nothing", "nothing", "nothing")
- end
-
- on doImportToonData2 me
- cursor(4)
- showStatusBar("Importing ToonData")
- updateStatusBar(1)
- set theFileName to fileObj(mFileName)
- updateStatusBar(1)
- fileObj(mdispose)
- updateStatusBar(1)
- set theNewIndex to getNewFileName(me)
- updateStatusBar(1)
- if PCflag then
- MSfileObj(mCopyFile, theFileName, toondataPath & theNewIndex)
- updateStatusBar(1)
- else
- set err to FileCopy(theFileName, toondataPath & theNewIndex, "DontShowProgress")
- if err <> (toondataPath & theNewIndex) then
- showTheAlertBox(err, #OK, EMPTY, EMPTY, EMPTY)
- end if
- updateStatusBar(1)
- end if
- updateStatusBar(100)
- cursor(-1)
- end
-
- on deleteXTMPLworkfiles me
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- set fileObj to FileIO(mnew, "write", the moviePath & "xtmpl2.dir")
- if objectp(fileObj) then
- fileObj(mDelete)
- end if
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- set fileObj to FileIO(mnew, "write", dlogdataPath & "xtmpl3.dir")
- if objectp(fileObj) then
- fileObj(mDelete)
- end if
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- end
-
- on makeDOSLegalName me, newFileName
- set oldDelimiter to the itemDelimiter
- set the itemDelimiter to "."
- repeat with itemNumber = 1 to the number of items in newFileName
- set newFileName2 to newFileName2 & item itemNumber of newFileName
- end repeat
- set the itemDelimiter to oldDelimiter
- set newFileName to EMPTY
- repeat with count = 1 to the number of words in newFileName2
- set newFileName to newFileName & word count of newFileName2
- end repeat
- set theFileName to truncateFileName(me, newFileName)
- return theFileName
- end
-
- on truncateFileName me, theName
- if length(theName) >= 8 then
- set theName to chars(theName, 1, the number of chars in theName - 1)
- return truncateFileName(me, theName)
- else
- return theName
- end if
- end
-
- on updateContentList me
- set found to 0
- set bgdCastNumber to getAt(getAt(bgdData, 1), 1)
- repeat with i = 1 to the number of lines in field "SCEdata"
- set testItem to item 4 of line i of field "SCEdata"
- set testItem to chars(testItem, 1, length(testItem) - 1)
- if testItem = bgdCastNumber then
- set bgdDataRecord to value(line i of field "SCEdata")
- set found to 1
- exit repeat
- end if
- end repeat
- if not found then
- repeat with i = 1 to the number of lines in field "SOLdata"
- set testItem to item 4 of line i of field "SOLdata"
- set testItem to chars(testItem, 1, length(testItem) - 1)
- if testItem = bgdCastNumber then
- set bgdDataRecord to value(line i of field "SOLdata")
- set found to 1
- exit repeat
- end if
- end repeat
- end if
- if found then
- setAt(contentList, 1, getAt(bgdDataRecord, 3))
- else
- setAt(contentList, 1, EMPTY)
- end if
- set listOfCharacters to []
- repeat with theLayer in dispatchTable
- if getAt(theLayer, 1) = "C" then
- append(listOfCharacters, getAt(theLayer, 2))
- end if
- end repeat
- setAt(contentList, 2, listOfCharacters)
- end
-
- on updateToonData me, index, newCredits, whichWindow
- set prevToonDataFileName to toonDataFileName
- if whichWindow = #open then
- set theDialogBox to openDialogBox
- else
- set theDialogBox to exportDialogBox
- end if
- tell theDialogBox
- cursor(4)
- end tell
- set toonDataFileName to getToonDataFileName(me, index)
- readFILEIO(me)
- setAt(fileDataList, 2, flattenCredits(me, newCredits))
- writeFILEIO(me)
- set toonDataFileName to prevToonDataFileName
- readFILEIO(me)
- tell theDialogBox
- cursor(-1)
- end tell
- end
-
- on readFILEIO me
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- set fileObj to FileIO(mnew, "read", toondataPath & toonDataFileName)
- if objectp(fileObj) then
- set toondataCheckStr to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- set fileDataList to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- set bgdData to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- set bgdFXData to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- set fgdFXData to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- set soundFXData to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- set soundLoopData to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- set dispatchTable to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- set fileLength to fileObj(mGetLength)
- set scoreData to []
- set tempList to []
- repeat with i = 1 to the maxinteger
- set curFilePos to fileObj(mGetPosition)
- if curFilePos >= (fileLength - 1) then
- exit repeat
- end if
- set tempList to value(fileObj(mReadToken, breakChar, breakChar))
- updateStatusBar(1)
- repeat with theFrame in tempList
- append(scoreData, theFrame)
- end repeat
- updateStatusBar(1)
- end repeat
- end if
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- end
-
- on writeFILEIO me
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- updateStatusBar(1)
- set fileObj to FileIO(mnew, "write", toondataPath & toonDataFileName)
- updateStatusBar(1)
- if objectp(fileObj) then
- set toondataCheckStr to line 1 of field "toondataCheckStrings"
- fileObj(mWriteString, string(toondataCheckStr) & breakChar)
- updateStatusBar(1)
- fileObj(mWriteString, string(fileDataList) & breakChar)
- updateStatusBar(1)
- fileObj(mWriteString, string(bgdData) & breakChar)
- updateStatusBar(1)
- fileObj(mWriteString, string(bgdFXData) & breakChar)
- updateStatusBar(1)
- fileObj(mWriteString, string(fgdFXData) & breakChar)
- updateStatusBar(1)
- fileObj(mWriteString, string(soundFXData) & breakChar)
- updateStatusBar(1)
- fileObj(mWriteString, string(soundLoopData) & breakChar)
- updateStatusBar(1)
- fileObj(mWriteString, string(dispatchTable) & breakChar)
- updateStatusBar(1)
- set scoreDataLength to count(scoreData)
- updateStatusBar(1)
- set maxFrames to scoreDataLength / 120
- updateStatusBar(1)
- set leftOverFrames to scoreDataLength mod 120
- updateStatusBar(1)
- set frameCount to 1
- updateStatusBar(1)
- set tempList to []
- updateStatusBar(1)
- repeat with j = 1 to maxFrames
- repeat with i = 1 to 120
- append(tempList, getAt(scoreData, frameCount))
- set frameCount to frameCount + 1
- end repeat
- fileObj(mWriteString, string(tempList) & breakChar)
- set tempList to []
- updateStatusBar(1)
- end repeat
- if leftOverFrames > 0 then
- repeat with i = 1 to leftOverFrames
- append(tempList, getAt(scoreData, frameCount))
- set frameCount to frameCount + 1
- end repeat
- fileObj(mWriteString, string(tempList) & breakChar)
- end if
- updateStatusBar(1)
- end if
- fileObj(mSetFinderInfo, "M!93", "SCTB")
- if objectp(fileObj) then
- fileObj(mdispose)
- end if
- end
-
- on saveStateOfToolBox me
- if toonDataFileName <> EMPTY then
- set found to 0
- repeat with i = 1 to the maxinteger
- if toonDataFileName = getNthFileNameInFolder(toondataPath, i) then
- set found to 1
- exit repeat
- end if
- end repeat
- if found then
- set savedToonDataIndex to i
- else
- set savedToonDataIndex to 0
- end if
- else
- set savedToonDataIndex to 0
- end if
- end
-